package com.kt.emall.ware.feigin;

import com.kt.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * Description: 调用product远程服务
 * Created with IntelliJ IDEA.
 *
 * @author: KamTeng
 * Date: 2021/6/25
 */
@FeignClient("emall-product")
public interface ProductFeignService {

    /**
     *         /product/skuinfo/info/{skuId}
     *         /api/product/skuinfo/info/{skuId}
     *
     *          1、让所有请求过网关：
     *              @FeignClient("emall-gateway")：给emall-gateway所在的机器发请求
     *              配置好请求路径/api/product/skuinfo/info/{skuId}
     *          2、直接让后台指定服务地址
     *              @FeignClient("emall-product")：给emall-product所在机器发请求
     *              路径/product/skuinfo/info/{skuId}
     * @param skuId
     * @return
     */
    @GetMapping("/product/skuinfo/info/{skuId}")
    public R info(@PathVariable("skuId") Long skuId);
}
